package org.ninekone.testGame;

import org.lwjgl.LWJGLException;
import org.lwjgl.input.Keyboard;
//import org.lwjgl.input.Mouse;
import org.lwjgl.opengl.Display;
import org.lwjgl.opengl.DisplayMode;

public class TestInput {
	private GameCharacter userGameCharacter;
	private Background background;
	
	public TestInput(GameCharacter gc, Background b){
		userGameCharacter=gc;
		background=b;
	}
	
	public void start() {
		try {
			Display.setDisplayMode(new DisplayMode(800, 600));
			Display.create();
		} catch (LWJGLException e) {
			e.printStackTrace();
			System.exit(0);
		}
		
		while (!Display.isCloseRequested()) {

			// render OpenGL here

			pollInput();
			Display.update();
		}

		Display.destroy();
	}
	
	public void pollInput(){
		/*if (Keyboard.isKeyDown(Keyboard.KEY_SPACE)) {
			System.out.println("JUMP");
		}
		if (Keyboard.isKeyDown(Keyboard.KEY_A)) {
			System.out.println("GO LEFT");
			System.out.println("Current X position: " + userGameCharacter.goLeft());
		}
		if (Keyboard.isKeyDown(Keyboard.KEY_D)) {
			System.out.println("GO RIGHT");
			System.out.println("Current X position: " + userGameCharacter.goRight());
		}
		if (Keyboard.isKeyDown(Keyboard.KEY_W)) {
			System.out.println("GO FORWARD");
			System.out.println("Current Z position: " + userGameCharacter.goForward());
		}
		if (Keyboard.isKeyDown(Keyboard.KEY_S)) {
			System.out.println("GO BACKWARD");
			System.out.println("Current Z position: " + userGameCharacter.goBackard());
		}*/
		
		//TODO gestire l'interazione col background
	}
}

